package com.naiterui.ehp.bs.doctor.repository;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bp.domain.MessagePushHistory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 查看推送历史消息
 *
 * @version 2015年7月17日 下午6:54:06 by chenlin
 * @Description 概述
 */
@Repository
public interface IMessagePushHistoryRepository extends BaseJpaRepository<MessagePushHistory, Long>  {


    Page<MessagePushHistory> findByDoctorIdAndCreatedAtLessThanEqual(Long doctorId, Date createdAt, Pageable pageable);


    List<MessagePushHistory> findTop1ByDoctorIdOrderByIdDesc(Long doctorId);


}
